package com.starbaba.controllog.model;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import com.starbaba.comment.model.EntityVO;
import com.starbaba.controllog.aop.LogAble;

public class ControlLogModel implements Serializable {
	
	/**
	 * 
	 */
	private static final long serialVersionUID = -1248951402498498120L;

	private String username;
	private Date date;
	private long id;
	private int operate;
	
	private ControlLogCategory firstCategoryVO;
	private ControlLogCategory secondCategoryVO;
	private ControlLogCategory biggestCategoryVO;
	private ControlLogCategory productCategoryVO;
	
	private static List<EntityVO> operateStauts;
	
	public ControlLogModel() {
	}
	
	public ControlLogModel(String username, Date date, int operate,
			ControlLogCategory firstCategoryVO,
			ControlLogCategory secondCategoryVO,
			ControlLogCategory biggestCategoryVO,
			ControlLogCategory productCategoryVO) {
		super();
		this.username = username;
		this.date = date;
		this.operate = operate;
		this.firstCategoryVO = firstCategoryVO;
		this.secondCategoryVO = secondCategoryVO;
		this.biggestCategoryVO = biggestCategoryVO;
		this.productCategoryVO = productCategoryVO;
	}
	
	private static void initOperateStauts() {
		operateStauts = new ArrayList<EntityVO>();
		EntityVO vo = new EntityVO();		
		vo.setKey(String.valueOf(LogAble.OPERATE_ADD));
		vo.setValue( "增加");
		operateStauts.add(vo);
		
		vo = new EntityVO();
		vo.setKey(String.valueOf(LogAble.OPERATE_DEL));
		vo.setValue("删除");
		operateStauts.add(vo);
		
		vo = new EntityVO();
		vo.setKey(String.valueOf(LogAble.OPERATE_MODIFY));
		vo.setValue("修改");
		operateStauts.add(vo);
	}
	
	
	public static List<EntityVO> getStatusList() {
		if (operateStauts == null) {
			initOperateStauts() ;
		}
		return operateStauts;
	}

	public String getUserName() {
		return username;
	}

	public void setUserName(String userName) {
		this.username = userName;
	}

	public Date getDate() {
		return date;
	}

	public void setDate(Date date) {
		this.date = date;
	}

	public long getId() {
		return id;
	}

	public void setId(long id) {
		this.id = id;
	}

	public int getOperate() {
		return operate;
	}

	public void setOperate(int operate) {
		this.operate = operate;
	}

	public ControlLogCategory getFirstCategoryVO() {
		return firstCategoryVO;
	}

	public void setFirstCategoryVO(ControlLogCategory firstCategoryVO) {
		this.firstCategoryVO = firstCategoryVO;
	}

	public ControlLogCategory getSecondCategoryVO() {
		return secondCategoryVO;
	}

	public void setSecondCategoryVO(ControlLogCategory secondCategoryVO) {
		this.secondCategoryVO = secondCategoryVO;
	}

	public ControlLogCategory getProductCategoryVO() {
		return productCategoryVO;
	}

	public void setProductCategoryVO(ControlLogCategory productCategoryVO) {
		this.productCategoryVO = productCategoryVO;
	}

	public ControlLogCategory getBiggestCategoryVO() {
		return biggestCategoryVO;
	}

	public void setBiggestCategoryVO(ControlLogCategory biggestCategoryVO) {
		this.biggestCategoryVO = biggestCategoryVO;
	}

	
}
